package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-04-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("service_charges")
@ApiModel(value="ServiceChargesEntity对象", description="")
public class ServiceChargeEntity implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "手续费")
    private BigDecimal handleFee;

    @ApiModelProperty(value = "服务费")
    private BigDecimal serviceFee;

    @ApiModelProperty(value = "渠道服务费")
    private BigDecimal channelServiceFee;

    @ApiModelProperty(value = "是否包含在票价")
    private Boolean handleFeeContain;

    @ApiModelProperty(value = "是否包含在票价")
    private Boolean serviceFeeContain;

    @ApiModelProperty(value = "是否包含在票价")
    private Boolean channelServiceFeeContain;

    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;

    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    public ServiceChargeEntity() {
    }
    
    public ServiceChargeEntity(BigDecimal channelServiceFee, Long cinemaId, Long tenantId) {
        this.handleFee = new BigDecimal("0.0");
        this.serviceFee = new BigDecimal("0.0");
        this.channelServiceFee = channelServiceFee;
        this.handleFeeContain = Boolean.FALSE;
        this.serviceFeeContain = Boolean.FALSE;
        this.channelServiceFeeContain = Boolean.FALSE;
        this.cinemaId = cinemaId;
        this.tenantId = tenantId;
    }
    
}
